<?php
class SF_Vendordiscount_Block_Adminhtml_Vendordiscount_Edit_tab_Form extends Mage_Adminhtml_Block_Widget_Form{
	protected function _prepareForm()
	{
		$form = new Varien_Data_Form();
		$this->setForm($form);
		$fieldset = $form->addFieldset('vendordiscount_form', array('legend'=>Mage::helper('vendordiscount')->__('Item information')));

		// $fieldset->addField('id', 'text', array(
		// 	'label'     => Mage::helper('vendordiscount')->__('id'),
		// 	// 'readonly'  => true,
		// 	'disabled' => true,
		// 	'name'      => 'id',
		// ));
		$fieldset->addField('id', 'label', array(  
		'label'     => Mage::helper('vendordiscount')->__('Id'),  
		)); 

		$fieldset->addField('vendor_id', 'select', array(
			'label'     => Mage::helper('vendordiscount')->__('vendor_id'),
			'required'  => true,
			'name'      => 'vendor_id',
			'values'    => Mage::getModel('vendordiscount/source_vendor')->getAllOptions(),
		));

		$fieldset->addField('logistics_type','text',array(
			'label'  =>  Mage::helper('vendordiscount')->__('logistics_type'),
			'required'  => true,
			'name'   =>  'logistics_type',
		));
		$fieldset->addField('discount', 'text', array(
			'label'     => Mage::helper('vendordiscount')->__('discount'),
			'required'  => true,
			'name'      => 'discount',
		));
	 
		if ( Mage::getSingleton('adminhtml/session')->getvendordiscountData() )
		{
			$form->setValues(Mage::getSingleton('adminhtml/session')->getvendordiscountData());
			Mage::getSingleton('adminhtml/session')->setvendordiscountData(null);
		} elseif ( Mage::registry('vendordiscount_data') ) {
			$form->setValues(Mage::registry('vendordiscount_data')->getData());
		}
		return parent::_prepareForm();
	}
}

